from rest_framework import viewsets, serializers
from deal.models import (
    Company, Project, TenderAnnouncement, BidOpeningRecord, BidOpeningDetail,
    BidEvaluationResult, BidCandidate, WinningResultAnnouncement, TransactionResult,
    TenderClarification, ProjectVersion, SubEntityVersion, VersionRelationship
)


class CompanySerializer(serializers.ModelSerializer):
    class Meta:
        model = Company
        fields = '__all__'


class ProjectSerializer(serializers.ModelSerializer):
    class Meta:
        model = Project
        fields = '__all__'


class TenderAnnouncementSerializer(serializers.ModelSerializer):
    class Meta:
        model = TenderAnnouncement
        fields = '__all__'


class BidOpeningRecordSerializer(serializers.ModelSerializer):
    class Meta:
        model = BidOpeningRecord
        fields = '__all__'


class BidOpeningDetailSerializer(serializers.ModelSerializer):
    class Meta:
        model = BidOpeningDetail
        fields = '__all__'


class BidEvaluationResultSerializer(serializers.ModelSerializer):
    class Meta:
        model = BidEvaluationResult
        fields = '__all__'


class BidCandidateSerializer(serializers.ModelSerializer):
    class Meta:
        model = BidCandidate
        fields = '__all__'


class WinningResultAnnouncementSerializer(serializers.ModelSerializer):
    class Meta:
        model = WinningResultAnnouncement
        fields = '__all__'


class TransactionResultSerializer(serializers.ModelSerializer):
    class Meta:
        model = TransactionResult
        fields = '__all__'


class TenderClarificationSerializer(serializers.ModelSerializer):
    class Meta:
        model = TenderClarification
        fields = '__all__'


class ProjectVersionSerializer(serializers.ModelSerializer):
    class Meta:
        model = ProjectVersion
        fields = '__all__'


class SubEntityVersionSerializer(serializers.ModelSerializer):
    class Meta:
        model = SubEntityVersion
        fields = '__all__'


class VersionRelationshipSerializer(serializers.ModelSerializer):
    class Meta:
        model = VersionRelationship
        fields = '__all__'


class CompanyViewSet(viewsets.ModelViewSet):
    queryset = Company.objects.all()
    serializer_class = CompanySerializer


class ProjectViewSet(viewsets.ModelViewSet):
    queryset = Project.objects.all()
    serializer_class = ProjectSerializer


class TenderAnnouncementViewSet(viewsets.ModelViewSet):
    queryset = TenderAnnouncement.objects.all()
    serializer_class = TenderAnnouncementSerializer


class BidOpeningRecordViewSet(viewsets.ModelViewSet):
    queryset = BidOpeningRecord.objects.all()
    serializer_class = BidOpeningRecordSerializer


class BidOpeningDetailViewSet(viewsets.ModelViewSet):
    queryset = BidOpeningDetail.objects.all()
    serializer_class = BidOpeningDetailSerializer


class BidEvaluationResultViewSet(viewsets.ModelViewSet):
    queryset = BidEvaluationResult.objects.all()
    serializer_class = BidEvaluationResultSerializer


class BidCandidateViewSet(viewsets.ModelViewSet):
    queryset = BidCandidate.objects.all()
    serializer_class = BidCandidateSerializer


class WinningResultAnnouncementViewSet(viewsets.ModelViewSet):
    queryset = WinningResultAnnouncement.objects.all()
    serializer_class = WinningResultAnnouncementSerializer


class TransactionResultViewSet(viewsets.ModelViewSet):
    queryset = TransactionResult.objects.all()
    serializer_class = TransactionResultSerializer


class TenderClarificationViewSet(viewsets.ModelViewSet):
    queryset = TenderClarification.objects.all()
    serializer_class = TenderClarificationSerializer


class ProjectVersionViewSet(viewsets.ModelViewSet):
    queryset = ProjectVersion.objects.all()
    serializer_class = ProjectVersionSerializer


class SubEntityVersionViewSet(viewsets.ModelViewSet):
    queryset = SubEntityVersion.objects.all()
    serializer_class = SubEntityVersionSerializer


class VersionRelationshipViewSet(viewsets.ModelViewSet):
    queryset = VersionRelationship.objects.all()
    serializer_class = VersionRelationshipSerializer